This example demonstrates the new operator overloading of record types supported by the Win32 compiler (DCC32).
It includes a unit named Vassbotn.Vcl.Complex that is a direct port of the corresponding .NET unit called Borland.Vcl.Complex. As far as possible I've tried to make the Win32 port as compatible and complete as possible.
The code can be used as-is if you need a native and relatively fast TComplex implementation (compared with the Variant-based implementation provided in the VarCmplx unit).
The unit can also be used as a starting point for implementing your own records with operator overloading. The code demonstrates how to use the following new Win32 compiler features:
Based on original code Copyright Borland
Adapted by Hallvard Vassbotn, http://hallvards.blogspot.com/
To use the Win32 Complex number unit in a Delphi 2006 project: